<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<ul id="accordion" class="accordion">
    <li>
        <div class="link" style="margin-top: 0;">光 敏 树 脂 材 料<i class="fa glyphicon glyphicon-chevron-down"></i></div>
        <ul class="submenu">
            <li><a href="../price/shuzhi-1gmsz.html">光敏树脂</a></li>
            <li><a href="../price/shuzhi-2tmsz.html">透明树脂</a></li>
            <li><a href="../price/shuzhi-3btmsz.html">半透明树脂</a></li>
            <li><a href="../price/shuzhi-4ngwsz.html">耐高温树脂</a></li>
            <li><a href="../price/shuzhi-5gjdsz.html">高精度高韧性树脂</a></li>
        </ul>
    </li>
    <li>
        <div class="link">尼 龙 材 料<i class="fa glyphicon glyphicon-chevron-down"></i></div>
        <ul class="submenu">
            <li><a href="../price/nilong-1gc.html">国产尼龙</a></li>
            <li><a href="../price/nilong-2jk.html">进口尼龙</a></li>
            <li><a href="../price/nilong-3bx.html">尼龙玻纤</a></li>
        </ul>
    </li>
    <li>
        <div class="link">金 属 材 料<i class="fa glyphicon glyphicon-chevron-down"></i></div>
        <ul class="submenu">
            <li><a href="../price/jinshu-1mjg.html">模具钢</a></li>
            <li><a href="../price/jinshu-2bxg.html">不锈钢</a></li>
            <li><a href="../price/jinshu-3thj.html">钛合金</a></li>
        </ul>
    </li>
</ul>
<script src="../bootstrap/js/jquery-1.11.3.js?VERSION=0.01"></script>
<script>
    var Accordion = function(el, multiple) {
        this.el = el || {};
        this.multiple = multiple || false;

        // Variables privadas
        var links = this.el.find('.link');
        // Evento
        links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
    }
    //为手风琴Accordion添加下拉菜单事件：
    Accordion.prototype.dropdown = function(e) {
        var $el = e.data.el;
        $this = $(this),
            $next = $this.next();

        $next.slideToggle();
        $this.parent().toggleClass('open');

        if (!e.data.multiple) {
            $el.find('.submenu').not($next).slideUp().parent().removeClass('open');
        };
    }
    //然后可以通过下面语句调用手风琴下拉菜单：
    var accordion = new Accordion($('#accordion'), false);

</script>